import axios from 'axios'

const request = axios.create({
    baseURL: "/API",
    timeout: 7000,
    //设置axios为form-data
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    transformRequest: [function (data) {
        let ret = ''
        for (let it in data) {
            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
        }
        return ret
    }]
})


export default request
